//
// Created by bigknife on 14-9-7.
// Copyright (c) 2014 51fmzg. All rights reserved.
//


#import <Foundation/Foundation.h>

@protocol IDLTaskButtonDelegate;

@interface IDLTaskButton : UIButton
@property (nonatomic) NSTimeInterval callbackTi;
@property (nonatomic) NSInteger counterMax;
@property (weak, nonatomic) IBOutlet id<IDLTaskButtonDelegate> delegate;
-(void) startTask;
-(void) endTask;

@end

@protocol IDLTaskButtonDelegate<NSObject>
/**
 *  计数器更新
 *
 *  @param button  button description
 *  @param counter counter description
 */
- (void)taskButton:(IDLTaskButton *)button updatedTo:(NSInteger)counter;
/**
 *  任务结束
 *
 *  @param button button description
 */
- (void)didEndTaskForTaskButton:(IDLTaskButton *)button;
/**
 *  是否开始任务
 *
 *  @param button button description
 *
 *  @return return value description
 */
- (BOOL) shouldStartTaskForTaskButton:(IDLTaskButton *)button;
/**
 *  任务开始
 *
 *  @param button button description
 */
- (void)didStartTaskForTaskButton:(IDLTaskButton *)button;
@end